package com.tgy.map.bean;

/**
 * @Author: tgy
 * @Date: 2020-09-27 16:33
 */
public class Person {

    private Integer age;

    public Person() {
    }

    public Person(Integer age) {
        this.age = age;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }

        if (!(o instanceof Person)) {
            return false;
        }

        Person person = (Person) o;

        return age != null ? age.equals(person.age) : person.age == null;
    }

    @Override
    public int hashCode() {
        return age != null ? age.hashCode() % 10 : 0;
    }

    @Override
    public String toString() {
        return "{" +
                "age=" + age +
                '}';
    }
}
